%h3 <%= plural_name %>

%table.list-table
  %tr
<% for attribute in attributes -%>
<% next if attribute.name == 'project_id' or attribute.name == 'content' -%>
    %th <%= ZhNames::MAP[attribute.name] || attribute.human_name %>
<% end -%>
    %th <%=ZhNames::MAP['created_at']%>
    %th <%=ZhNames::MAP['updated_at']%>
    %th

  - @<%= plural_name %>.each do |m|
    %tr{:id => "r_#{m.id}"}
<% for attribute in attributes -%>
<% next if attribute.name == 'project_id' or attribute.name == 'content' -%>
<% if attribute.name == 'registrar_id' -%>
      %td= m.registrar.name
<% elsif ['importance','urgency','status'].include?(attribute.name) -%>
      %td= m.<%=attribute.name%>_name
<% elsif attribute.name == 'confirmed' -%>
      %td= m.confirmed ? <%=ZhNames::MAP['y:n']%>
<% else -%>
      %td= m.<%=attribute.name%>
<% end -%>
<% end -%>
      %td= m.created_at.datetime_ydyn
      %td= m.updated_at.datetime_ydyn unless m.updated_at==m.created_at
      %td
        = link_to '<%=ZhNames::MAP['show']%>', resource_path(m)
        = link_to '<%=ZhNames::MAP['edit']%>', edit_resource_path(m)
        = link_to '<%=ZhNames::MAP['delete']%>', resource_path(m), :confirm => '<%=ZhNames::MAP['delete_confirm']%>', :method => :delete, :remote => true
#div(style="float:right;")= will_paginate @<%= plural_name %>
%br

= link_to '<%=ZhNames::MAP['add']%>', new_resource_path
